<template>
  <div class="monthly-flower-page">
    <h2 class="section-title">每月花期</h2>
    <p class="section-description">了解不同月份的应季鲜花，选择最佳时令花材</p>
    
    <div class="month-selector">
      <button 
        v-for="(month, index) in months" 
        :key="index"
        class="month-btn"
        :class="{ 'active': activeMonth === index }"
        @click="activeMonth = index"
      >
        {{ month }}
      </button>
    </div>
    
    <div class="flower-calendar">
      <div class="month-info">
        <h3 class="month-title">{{ months[activeMonth] }}花期指南</h3>
        <p class="month-description">{{ monthDescriptions[activeMonth] }}</p>
      </div>
      
      <div class="seasonal-flowers">
        <div class="flower-card" v-for="flower in getMonthFlowers()" :key="flower.id">
          <div class="flower-image" :style="{ backgroundColor: flower.color }"></div>
          <div class="flower-info">
            <h4 class="flower-name">{{ flower.name }}</h4>
            <p class="flower-description">{{ flower.description }}</p>
            <div class="flower-tags">
              <span class="tag" v-for="(tag, index) in flower.tags" :key="index">{{ tag }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <div class="flower-care-tips">
      <h3 class="section-title">季节性养护提示</h3>
      <div class="tips-container">
        <div class="tip-card" v-for="tip in seasonalTips[activeMonth]" :key="tip.id">
          <div class="tip-icon">{{ tip.icon }}</div>
          <div class="tip-content">
            <h4 class="tip-title">{{ tip.title }}</h4>
            <p class="tip-description">{{ tip.description }}</p>
          </div>
        </div>
      </div>
    </div>
    
    <div class="subscription-banner">
      <div class="banner-content">
        <h3 class="banner-title">订阅每月精选花束</h3>
        <p class="banner-description">每月收到一束精心挑选的应季鲜花，享受大自然的馈赠</p>
        <div class="subscription-options">
          <div class="option-card" v-for="option in subscriptionOptions" :key="option.id">
            <h4 class="option-title">{{ option.title }}</h4>
            <p class="option-price">¥{{ option.price }}<span class="price-period">/{{ option.period }}</span></p>
            <ul class="option-features">
              <li v-for="(feature, index) in option.features" :key="index">{{ feature }}</li>
            </ul>
            <button class="btn-primary">立即订阅</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'MonthlyFlowerCalendar',
  data() {
    return {
      activeMonth: new Date().getMonth(),
      months: [
        '一月', '二月', '三月', '四月', '五月', '六月',
        '七月', '八月', '九月', '十月', '十一月', '十二月'
      ],
      monthDescriptions: [
        '一月是冬季的中心，虽然户外花卉较少，但有许多适合室内的花卉盛开。',
        '二月是早春的开始，一些早春花卉开始绽放，为即将到来的春天做准备。',
        '三月是春天的开始，各种春季花卉开始盛开，为大地带来色彩。',
        '四月是春季的高峰期，众多花卉竞相绽放，是赏花的最佳时节之一。',
        '五月是春末夏初，温暖的天气使得更多花卉盛开，色彩丰富。',
        '六月是初夏时节，夏季花卉开始盛开，带来明亮的色彩。',
        '七月是盛夏时节，耐热的花卉盛开，为炎热的夏天带来清凉。',
        '八月仍是夏季，但一些秋季花卉开始准备绽放，季节开始过渡。',
        '九月是初秋时节，秋季花卉开始盛开，带来丰收的气息。',
        '十月是秋季的高峰期，秋季花卉盛开，色彩变得温暖。',
        '十一月是深秋时节，一些耐寒的花卉仍在盛开，为即将到来的冬天做准备。',
        '十二月是初冬时节，虽然户外花卉减少，但有许多适合室内的花卉和节日装饰植物。'
      ],
      flowersByMonth: [
        // 一月
        [
          { id: 1, name: '水仙花', description: '水仙花在冬季盛开，象征着重生和新的开始。', color: '#f5f5f5', tags: ['香气浓郁', '室内花卉', '球根花卉'] },
          { id: 2, name: '蝴蝶兰', description: '蝴蝶兰是一种优雅的室内花卉，在冬季开花，花期长达数月。', color: '#f3e5f5', tags: ['室内花卉', '长花期', '送礼佳选'] },
          { id: 3, name: '山茶花', description: '山茶花在冬季盛开，有红、粉、白等多种颜色，象征着坚强和持久。', color: '#ffcdd2', tags: ['耐寒', '观赏价值高', '园林花卉'] }
        ],
        // 二月至十二月的花卉数据...
      ],
      seasonalTips: [
        // 一月
        [
          { id: 1, icon: '🌡️', title: '注意保暖', description: '冬季室内花卉需要避免寒风和暖气直吹，保持适宜温度。' },
          { id: 2, icon: '💧', title: '控制浇水', description: '冬季植物生长缓慢，应减少浇水频率，避免根部腐烂。' }
        ],
        // 二月至十二月的养护提示...
      ],
      subscriptionOptions: [
        {
          id: 1,
          title: '月度精选',
          price: 199,
          period: '月',
          features: [
            '每月1束精选应季鲜花',
            '专业花艺师设计',
            '免费配送',
            '附赠养护指南'
          ]
        },
        {
          id: 2,
          title: '季度尊享',
          price: 549,
          period: '季度',
          features: [
            '每月1束高级应季鲜花',
            '专属花艺师定制',
            '优先配送',
            '附赠精美花瓶',
            '专业养护指导'
          ]
        }
      ]
    };
  },
  methods: {
    getMonthFlowers() {
      return this.flowersByMonth[this.activeMonth];
    }
  }
};
</script>

<style scoped>
.monthly-flower-page {
  color: #333;
}

.section-title {
  color: #e75480;
  margin-bottom: 0.5rem;
}

.section-description {
  color: #666;
  margin-bottom: 2rem;
}

.month-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background-color: rgba(249, 249, 249, 0.8);
  padding: 1rem;
  border-radius: 8px;
}

.month-btn {
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.month-btn:hover {
  background-color: #f8e1e7;
  color: #e75480;
}

.month-btn.active {
  background-color: #e75480;
  color: white;
}

.flower-calendar {
  margin-bottom: 3rem;
}

.month-info {
  margin-bottom: 1.5rem;
}

.month-title {
  font-size: 1.5rem;
  color: #e75480;
  margin-bottom: 0.5rem;
}

.month-description {
  color: #666;
  line-height: 1.6;
}

.seasonal-flowers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.flower-card {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.flower-card:hover {
  transform: translateY(-5px);
}

.flower-image {
  height: 180px;
}

.flower-info {
  padding: 1.5rem;
}

.flower-name {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.flower-description {
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.flower-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background-color: #f8e1e7;
  color: #e75480;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.flower-care-tips {
  margin-bottom: 3rem;
}

.tips-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.tip-card {
  background-color: rgba(249, 249, 249, 0.8);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tip-icon {
  font-size: 2rem;
}

.tip-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.tip-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

.subscription-banner {
  background-color: rgba(248, 225, 231, 0.8);
  border-radius: 12px;
  padding: 2rem;
}

.banner-title {
  font-size: 1.8rem;
  color: #e75480;
  margin-bottom: 1rem;
  text-align: center;
}

.banner-description {
  color: #666;
  margin-bottom: 2rem;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.subscription-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.option-card {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.option-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #e75480;
}

.option-price {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: #333;
}

.price-period {
  font-size: 1rem;
  color: #888;
}

.option-features {
  text-align: left;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.option-features li {
  margin-bottom: 0.5rem;
  color: #666;
}

.btn-primary {
  padding: 0.8rem 1.5rem;
  background-color: #e75480;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 1rem;
  width: 100%;
}

.btn-primary:hover {
  background-color: #d64d7b;
}

@media (max-width: 768px) {
  .month-selector {
    justify-content: center;
  }
  
  .seasonal-flowers, .tips-container {
    grid-template-columns: 1fr;
  }
  
  .subscription-options {
    grid-template-columns: 1fr;
  }
  
  .banner-title {
    font-size: 1.5rem;
  }
}
</style>